﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>瀑布过渡-jq22.com</title>
<script src="https://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<style>
* {
  margin: 0;
  padding: 0;
  font: inherit;
}

.grid {
  display: grid;
}

body {
  min-height: 100vh;
  background: #f2f3f9;
}

main {
  place-self: center;
  overflow: hidden;
  max-width: 56.25em;
  box-shadow: -16px 16px 23px currentcolor;
  background: #fff;
  color: #b9b7bb;
  font: 1em/1.25 ubuntu, trebuchet ms, sans-serif;
}

article {
  --not-sel: min(1, max(var(--k) - var(--i), var(--i) - var(--k)));
  --sel: calc(1 - var(--not-sel));
  --sgn-sel: calc(2*var(--sel) - 1);
  --pad: min(1.5em, 5vw);
  grid-area: 1/1;
  grid-auto-flow: column;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24em), 1fr));
  z-index: var(--sel);
  padding: var(--pad);
  transition: z-index 0s 1s;
}

a1 {
  font-size: 0.875em;
  text-decoration: none;
  color: #000;
}
a1:focus {
  outline: none;
}
a1:hover, a:focus {
  color: mediumvioletred;
}

.c--ini {
  grid-column: 1;
}

.c--fin {
  grid-column-end: -1;
}

.fade {
  transform: translatey(calc(var(--not-sel)*2rem));
  opacity: var(--sel);
  transition: transform 1s ease-out calc(var(--sel)*1s), opacity 1s ease-in calc(var(--sel)*1s);
}

h3 {
  font-size: clamp(1.25em, 8vw, 2.5em);
  font-weight: 900;
  place-self: end center;
  padding: 0 0 1em;
  color: #2c2a2e;
}

p {
  padding: 0 5vw;
  color: #989898;
  font-size: 0.875em;
}

.nav1 {
  place-self: start center;
  margin: 0.5em 0 2em;
  border: solid 1px #e0dee0;
  padding: 1em min(2.5em, 5vw);
  border-radius: 4em;
  font-weight: 700;
  text-align: center;
}

section {
  grid-row-end: span 3;
  clip-path: inset(calc(-1*var(--pad)) 0);
}

.slice {
  --p: calc(var(--j)/var(--m));
  --s: calc((1 + var(--j))/var(--m)*100%);
  --mask:
    linear-gradient(90deg,
      transparent calc(var(--p)*100% - 1px),
      red calc(var(--p)*100%) var(--s),
      transparent calc(var(--s) + 1px));
  grid-area: 1/1;
  height: 50vmin;
  transform: translatey(calc(var(--not-sel)*(-100% - var(--pad) - 1px)));
  background: var(--img) 50%/cover;
  -webkit-mask: var(--mask);
  mask: var(--mask);
  transition: transform 1s ease-out calc((var(--sel) + var(--p))*1s);
}

.det {
  grid-auto-flow: column;
  grid-gap: 0.5em;
  place-content: end start;
  place-self: end start;
  position: relative;
  z-index: 2;
  padding: 0 1em;
  height: 0;
  line-height: 2;
  white-space: nowrap;
}
.det::before {
  position: absolute;
  z-index: -1;
  bottom: 0;
  height: 2em;
  width: 100%;
  background: #fff;
  content: "";
}
.det::after {
  content: "?";
}</style>
</head>
<body>
<body class="grid">
  <main class="grid" style="--n: 3; --k: 0">
    <article class="grid" id="a0" style="--i: 0">
      <h3 class="c--ini fade">南京新协和医院</h3>
      <p class="c--ini fade">南京新协和医院是一家以治疗不孕不育为特色的二级综合医院，是南京市医保定点医
        院。医院设有女性不孕科、男性不育科、妇科、产科、中医科、康复科、超声科、医学检验科、医学影像科等临床和医技科室。<br><br>地址:南京市秦淮区光华路
        海福巷1号 <br>电话:+86(25) 5877 1808<br><br>医生姓名：左萍<br>
        职务与职称：主任医师、妇产科主任。<br>
        诊治范围：阴道炎、盆腔炎、子宫肌瘤等疾病的诊断和治疗。</p>
      <a1 class="nav1 c--ini fade" href="#a1">南京理工大学校医院</a1>
      <section class="grid c--fin" role="img" aria-label="photo of previously described cat" style="--img: url(https://img1.baidu.com/it/u=444609218,1682665137&fm=26&fmt=auto); --m: 8">
        <div class="slice" aria-hidden="true" style="--j: 0"></div>
        <div class="slice" aria-hidden="true" style="--j: 1"></div>
        <div class="slice" aria-hidden="true" style="--j: 2"></div>
        <div class="slice" aria-hidden="true" style="--j: 3"></div>
        <div class="slice" aria-hidden="true" style="--j: 4"></div>
        <div class="slice" aria-hidden="true" style="--j: 5"></div>
        <div class="slice" aria-hidden="true" style="--j: 6"></div>
        <div class="slice" aria-hidden="true" style="--j: 7"></div>
      </section>
    </article>
    <article class="grid" id="a1" style="--i: 1">
      <h3 class="c--ini fade">南京理工大学校医院</h3>
      <p class="c--ini fade">南京理工大学校医院是一所综合性医院,医院设有内、外、妇、儿、中医、眼科、口腔科、耳鼻喉科、预防保健科等22个科室。
        已形成以医疗、预防为中心，以内外科为主体，以脑血管病、风湿病治疗为服务特色的综合性医院。<br><br>地址:南京市玄武区孝陵卫街道200号551栋<br>电话:+86(25) 5431 5371</p>
      <a1 class="nav1 c--ini fade" href="#a2">南京总医院</a1>
      <section class="grid c--fin" role="img" aria-label="photo of previously described cat" style="--img: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.120job.cn%2FUploadFiles%2FFckeditor%2Fimage%2F222%281%29.png&refer=http%3A%2F%2Fwww.120job.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1641311746&t=18fc5b9a335605b529ffb107d03c964e); --m: 8">
        <div class="slice" aria-hidden="true" style="--j: 0"></div>
        <div class="slice" aria-hidden="true" style="--j: 1"></div>
        <div class="slice" aria-hidden="true" style="--j: 2"></div>
        <div class="slice" aria-hidden="true" style="--j: 3"></div>
        <div class="slice" aria-hidden="true" style="--j: 4"></div>
        <div class="slice" aria-hidden="true" style="--j: 5"></div>
        <div class="slice" aria-hidden="true" style="--j: 6"></div>
        <div class="slice" aria-hidden="true" style="--j: 7"></div>
      </section>
    </article>
    <article class="grid" id="a2" style="--i: 2">
      <h3 class="c--ini fade">南京总医院</h3>
      <p class="c--ini fade">中国人民解放军东部战区总医院始建于1929年，前身为国民政府中央医院，是一所历史悠久、医教研协调发展的大型现代化综合性医院。
        <br><br>地址:南京市玄武区中山东路305号<br>电话:+86(25) 8086 0114<br><br>医生姓名：黎承军<br>
        职务与职称：骨科副主任医师，医学博士，博士后。<br>
        诊治范围：骨盆、四肢骨与软组织肿瘤的手术与综合治疗。</p>
      <a1 class="nav1 c--ini fade" href="#a0">南京新协和医院</a1>
      <section class="grid c--fin" role="img" aria-label="photo of previously described cat" style="--img: url(https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.qc99.com%2Fyiyao%2FUploadFiles_7250%2F200812%2F20081231131710802.jpg&refer=http%3A%2F%2Fwww.qc99.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1641311684&t=0fb6fac45c10e1547f480e4295a9ebe7); --m: 8">
        <div class="slice" aria-hidden="true" style="--j: 0"></div>
        <div class="slice" aria-hidden="true" style="--j: 1"></div>
        <div class="slice" aria-hidden="true" style="--j: 2"></div>
        <div class="slice" aria-hidden="true" style="--j: 3"></div>
        <div class="slice" aria-hidden="true" style="--j: 4"></div>
        <div class="slice" aria-hidden="true" style="--j: 5"></div>
        <div class="slice" aria-hidden="true" style="--j: 6"></div>
        <div class="slice" aria-hidden="true" style="--j: 7"></div>
      </section>
    </article>
  </main>
</body>

<script>
let _MAIN = document.querySelector('main'),
N = +_MAIN.style.getPropertyValue('--n');

let k = +_MAIN.style.getPropertyValue('--k');

addEventListener('click', e => {
  let _t = e.target;

  if (_t.classList.contains('nav1')) _MAIN.style.setProperty('--k', k = (k + 1) % N);
});</script>

</body>
</html>
